package com.gosophia.conference.action.notification;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.userManagement.dto.UserInfoDTO;
import com.gosophia.userManagement.ws.UserManagementWebService;

/**
 * 获取审批人Action，不包括起草人
 * @author gaoweiguang
 * @since  2011-3-26
 *  Copyright (c) 2010 Gosophia corporation All Rights Reserved
 */
@Scope("prototype")
@Controller("GetNotificationUserInfoAllAction")
public class GetNotificationUserInfoAllAction extends BaseSupportAction{

	private static final long serialVersionUID = 188780888656710659L;
	
	private Long jobId;
	
	@Autowired
	private UserManagementWebService userManagementWebService;
	
	private List<UserInfoDTO> userInfoDTO = new ArrayList<UserInfoDTO>();
	
	@Override
	public String _execute() throws Exception {
//		UserDetailsImpl userDetails = (UserDetailsImpl) SecurityContextHolder
//        .getContext().getAuthentication().getPrincipal();
//		Long userInfoId = userDetails.getUserAccountDTO().getUserInfoDTO().getUserInfoId();
		userInfoDTO = userManagementWebService.findAllUserInfoHasAccount();
//		Long simulatorId = null;
//		if (jobId != null) {
//			simulatorId = taskManagementWebService
//					.findJobDetailByJobId(jobId).getMissionDTO()
//					.getUndertakerDTO().getUserInfoId();
//
//		}
//		List<UserInfoDTO> userInfoDTOs = userManagementWebService.findAllUserInfoHasAccount();
//		for(UserInfoDTO u:userInfoDTOs){
//			if(!u.getUserInfoId().equals(userInfoId)){
//				if(jobId != null ){
//					if(!u.getUserInfoId().equals(simulatorId)){
//						userInfoDTO.add(u);
//					}
//				}else{
//					userInfoDTO.add(u);
//				}
//			}
//		}
		return SUCCESS;
	}

	public List<UserInfoDTO> getUserInfoDTO() {
		return userInfoDTO;
	}

	public void setUserInfoDTO(List<UserInfoDTO> userInfoDTO) {
		this.userInfoDTO = userInfoDTO;
	}

	public void setJobId(Long jobId) {
		this.jobId = jobId;
	}

	public Long getJobId() {
		return jobId;
	}

    	
}
